import request from "@/utils/request";

// 查询商品列表
export function listMallSpu(query) {
  return request({
    url: "/mall/mallSpu/list",
    method: "get",
    params: query,
  });
}

// 查询商品列表
export function innerListMallSpu(query) {
  return request({
    url: "/mall/mallSpu/innerList",
    method: "get",
    params: query,
  });
}

// 查询商品详细
export function getMallSpu(id) {
  return request({
    url: "/mall/mallSpu/" + id,
    method: "get",
  });
}

// 新增商品
export function addMallSpu(data) {
  return request({
    url: "/mall/mallSpu",
    method: "post",
    data: data,
  });
}

// 商品审核
export function allVerify(ids, verifyState) {
  return request({
    url: `/mall/mallSpu/verifys/${ids}/${verifyState}`,
    method: "post",
  });
}

// 商品审核
export function verify(data) {
  return request({
    url: "/mall/mallSpu/verify",
    method: "post",
    data: data,
  });
}

// 商品上下架
export function valid(data) {
  return request({
    url: "/mall/mallSpu/valid",
    method: "post",
    data: data,
  });
}

// 修改商品
export function updateMallSpu(data) {
  return request({
    url: "/mall/mallSpu",
    method: "put",
    data: data,
  });
}

// 删除商品
export function delMallSpu(id) {
  return request({
    url: "/mall/mallSpu/" + id,
    method: "delete",
  });
}

// 新增分账接收方
export function applyLedgerReceiver(data) {
  return request({
    url: "/mall/mallStore/applyLedgerReceiver",
    method: "post",
    data: data,
  });
}